#!/bin/sh

ver_new="$1"
ver_old="$2"

if [ "$(apk version -t "$ver_old" "5.0.1-r0")" = '<' ]; then
	# Copy /etc/conf.d/knot-resolver to kresd *if* it was modified by user.
	if apk audit -q /etc/conf.d | grep -q knot-resolver && ! [ -f /etc/conf.d/kresd ]; then
		cp -a /etc/conf.d/knot-resolver /etc/conf.d/kresd
	fi
fi
